﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using 数据迁移工具.Common.DbContext;

namespace 数据迁移工具.Factory
{
    public class DbFactory
    {
        public static SugarDbContext CreateDbContext(DbType dbtype, ConnectionConfig srcConnConfig)
        {
            switch (dbtype)
            {
                case DbType.MySql:
                    return new MySqlDbContext(srcConnConfig);
                case DbType.SqlServer:
                    break;
                case DbType.Sqlite:
                    return new SqliteDbContext(srcConnConfig);
                case DbType.Dm:
                    return new DmDbContext(srcConnConfig);
                case DbType.Oracle:
                    return new OracleDbContext(srcConnConfig);
                default:
                    break;
            }
            return null;
        }
    }
}
